﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Tesla.Service.DataContracts;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Logging;
using System.ServiceModel;
using Tesla.Service.WcfServiceCommon;
//using Telerik.Web.UI;
using Tesla.Util.Utilities;
using System.IO;

namespace Tesla.Web.Pages
{
    public partial class UserLoginForm : PageBase
    {
        #region Class Level Variables
        private UserLoginServiceDispatcher loginServiceDispatcher = null;
        #endregion


        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        

        
        protected void login_Click(object sender, EventArgs e)
        {
            loginServiceDispatcher = new UserLoginServiceDispatcher();
            bool? userExists = false;
            loginServiceDispatcher.ValidateUser(UserID.Text, Password.Text, ref userExists);

            if(Convert.ToBoolean(userExists))
                Response.Redirect(VirtualPathUtility.ToAbsolute("~/") + @"Pages/LandingPage.aspx", false);
        }
}
}
